<template>
    <div class="showCar-Container"> 
        <div class="car_list">
            <el-table
                :data="carList"
                border
                style="width: 100%"
                empty-text="暂无商品">
                <el-table-column
                type="selection">
                </el-table-column>

                <el-table-column
                    type="index"
                    label="序号">
                </el-table-column> 

                <el-table-column
                    prop="book_name"
                    label="商品名称">
                </el-table-column>
                
                <el-table-column
                    prop="book_price"
                    label="单价">
                </el-table-column>
                
                <el-table-column
                    label="商品照片">
                    <template slot-scope="scope">
                         <img :src="require('@/assets/images/books/' + book_image)" class="image">
                    </template>    
                </el-table-column>

                <el-table-column
                    prop="car_count"
                    label="购买数量">
                </el-table-column>            

                <el-tabe-column
                    prop="total"
                    label="合计">
                </el-tabe-column>                
            </el-table>
        </div>
    </div>
</template>

<script>

export default {
    data(){
        return{
            carList:[],//购物车列表
        }
    },methods:{
        /**
         * 获得购物车信息
         */
          queryCars(){
             this.$axios
             .get('car/queryCarInfo')
             .then(response=>{
                 this.carList=response.data;
             })
             .catch(error=>{
                alert(error)
             })
          }
    },created(){
           this.queryCars();
    }
}
</script>

<style scoped>

</style>